package com.enhe.gck.pojo;

import com.alibaba.fastjson.annotation.JSONField;
import com.enhe.gck.CarbonRelationType;
import com.kuangkie.carbon.record.Updatable;
import com.kuangkie.carbon.record.annotation.Attribute;
import com.kuangkie.carbon.record.annotation.CarbonRecord;
import com.kuangkie.carbon.record.annotation.RecordCode;
import com.kuangkie.carbon.record.annotation.Relation;
import com.kuangkie.carbon.uid.model.UidManager;
import lombok.Data;

import java.time.LocalDate;
import java.time.LocalDateTime;

// 编织袋管理
@CarbonRecord("hwane21190")
@Data
public class WovenBag implements Updatable{
    @JSONField(name="唯一编码")
    @RecordCode
    private Long id = UidManager.getLongUID();

    // 数量
    @JSONField(name="数量")
    @Attribute("hwan21192")
    private Integer number;

    // 日期
    @JSONField(name="日期")
    @Attribute("hwan21196")
    private LocalDate date;

    // 删除
    @JSONField(name="删除")
    @Attribute("hwan21197")
    private Boolean isDelete;

    // 确认
    @JSONField(name="确认")
    @Attribute("hwan21198")
    private Boolean isUsing;

    // 备注
    @JSONField(name="备注")
    @Attribute("hwan21199")
    private String remark;

    // 类型
    @JSONField(name="类型")
    @Attribute("hwan21248")
    private String type;

    // 名称
    @JSONField(name="名称")
    @Attribute("hwan21283")
    private String name;

    @JSONField(name="领用数")
    @Attribute("hwan21310")
    private Integer receive;
    @JSONField(name="前班次转交数")
    @Attribute("hwan21311")
    private Integer transmit;
    @JSONField(name="剩余数")
    @Attribute("hwan21312")
    private Integer surplus;

    @JSONField(name="使用数")
    @Attribute("hwan21284")
    private Integer use;
    @JSONField(name="补包数")
    @Attribute("hwan21309")
    private Integer repair;
    @JSONField(name="退包数")
    @Attribute("hwan21285")
    private Integer cancel;
    @JSONField(name="破损数")
    @Attribute("hwan21286")
    private Integer worn;

    @JSONField(name="剩余确认")
    @Attribute("hwan21300")
    private Boolean isConfirmRemain;
    @JSONField(name="转交确认")
    @Attribute("hwan21331")
    private Boolean isConfirmTransmit;

    @JSONField(name="确认时间")
    @Attribute("hwan21321")
    private LocalDateTime confirmTime;
    @JSONField(name="剩余确认时间")
    @Attribute("hwan21322")
    private LocalDateTime residueConfirmTime;

    @Relation(CarbonRelationType.RR_编织袋管理_班次_班次管理)
    private Classes classes;
    @JSONField(name = "命令")
    @Attribute("hwan21342")
    private String command;
    @Override
    public String getRecordCode() {
        return this.id==null ? null : this.id.toString();
    }
}